$(function () {
    $('.nav-sidebar>li>a').click(function (event) {
        var that = $(this);
        if(that.children('a').attr('href') == '#'){
            event.preventDefault();
        }
        if(that.parent().hasClass('unfold')){
            that.parent().removeClass('unfold');
        }else{
            that.parent().addClass('unfold').siblings().removeClass('unfold');
        }
        console.log('coming....');
    });

    $('.nav-sidebar a').mouseleave(function () {
        $(this).css('text-decoration','none');
    });
});


$(function () {
    var url = window.location.href;
    if(url.indexOf('item') >= 0){
        var profileLi = $('.item-manage');
        profileLi.addClass('unfold').siblings().removeClass('unfold');
    } else if(url.indexOf('fuser') >= 0){
        var postManageLi = $('.fuser-manage');
        postManageLi.addClass('unfold').siblings().removeClass('unfold');
    } else if(url.indexOf('buser') >= 0){
        var postManageLi1 = $('.buser-manage');
        postManageLi1.addClass('unfold').siblings().removeClass('unfold');
    }
});